package com.hig.onlineexam.controller;

import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.hig.exam.domain.ExamTaskManager;
import com.hig.exam.service.IExamTaskManagerService;
import com.hig.onlineexam.domain.ExamFinishAnswer;
import com.hig.onlineexam.mapper.ExamFinishAnswerMapper;
import com.hig.questions.domain.ExamQuestionsProperty;
import com.hig.questions.mapper.ExamQuestionsPropertyMapper;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hig.onlineexam.domain.dto.ExamQuestionsContentData;
import com.hig.onlineexam.domain.dto.ExamQuestionsData;
import com.hig.onlineexam.service.IExamQuestionsContentDataService;
import com.hig.questions.domain.ExamQuestionsAnswer;
import com.hig.questions.service.IExamQuestionsAnswerService;
import com.hig.utils.DigitUtils;
import com.ruoyi.common.core.domain.AjaxResult;

@RestController
@RequestMapping("/onlineexam")
@Api("考试试题相关信息")
public class ExamQuestionsContentDataController {
	@Autowired
	private IExamQuestionsContentDataService examQuestionsContentDataService;
	
    @Autowired
    private IExamQuestionsAnswerService examQuestionsAnswerService;
	
    @GetMapping("/content")
    public AjaxResult option(@RequestBody ExamQuestionsContentData examQuestionsContentData)
    {
        ExamQuestionsContentData contentData = examQuestionsContentDataService.selectExamQuestionsContent(examQuestionsContentData);
        return AjaxResult.success(contentData);
    }





    
    @PostMapping("/data")
    @ApiOperation("用户点击开始按钮之后 返回试题信息")
    public AjaxResult data(@RequestBody ExamQuestionsContentData examQuestionsContentData) {
        ExamQuestionsData e =examQuestionsContentDataService.convertQuestion(examQuestionsContentData);

        return AjaxResult.success(e);
    }


}
